Skip to content

fix(security): mask credentials, not sentences that mention them - #392

Merged
dan-petty merged 1 commit into
release/v0.2.22from
fix/sanitizer-prose-false-positive
Sep 22, 2026
Merged

dan-petty merged 1 commit into
release/v0.2.22from
fix/sanitizer-prose-false-positive

Conversation

@dan-petty

Copy link
Copy Markdown
Owner

The keyword rule matched any word of ten characters or more following secret, token, password, bearer or api_key. In prose that word is usually English, so the commit subject "unify secret resolution and manage Vault lease lifecycle" was rewritten to "unify and manage Vault lease lifecycle".

That is not confined to a terminal. The changelog is masked on its way out and the release description is written from the changelog, so the corruption reached the published notes for v0.2.21 -- "Integrated client-side and capacity-aware dispatch" -- where it reads as though a credential had been caught rather than a phrase mangled. "secret storage" survived only because "storage" is seven characters, which is the kind of accident that makes the rule look like it works.

A credential is distinguishable from a word: it carries a digit, a capital, or a separator, or it is longer than any English word. The value is now inspected instead of assumed. Bearer ghp_A1b2..., token abc123def456ghi789 and a twenty-six character opaque string are still masked; "secret resolution", "token counting" and "password management policy" are left alone. The specific rules -- AWS keys, GitHub tokens, private key blocks -- are untouched, and a test covers one of them to confirm narrowing the general rule did not weaken them.

Found while compiling the v0.2.22 changelog, where the same subject came through mangled again.

The keyword rule matched any word of ten characters or more following `secret`, `token`, `password`, `bearer` or `api_key`. In prose that word is usually English, so the commit subject "unify secret resolution and manage Vault lease lifecycle" was rewritten to "unify <masked-token> and manage Vault lease lifecycle".

That is not confined to a terminal. The changelog is masked on its way out and the release description is written from the changelog, so the corruption reached the published notes for v0.2.21 -- "Integrated client-side <masked-token> and capacity-aware dispatch" -- where it reads as though a credential had been caught rather than a phrase mangled. "secret storage" survived only because "storage" is seven characters, which is the kind of accident that makes the rule look like it works.

A credential is distinguishable from a word: it carries a digit, a capital, or a separator, or it is longer than any English word. The value is now inspected instead of assumed. `Bearer ghp_A1b2...`, `token abc123def456ghi789` and a twenty-six character opaque string are still masked; "secret resolution", "token counting" and "password management policy" are left alone. The specific rules -- AWS keys, GitHub tokens, private key blocks -- are untouched, and a test covers one of them to confirm narrowing the general rule did not weaken them.

Found while compiling the v0.2.22 changelog, where the same subject came through mangled again.
@dan-petty
dan-petty merged commit 26642ad into release/v0.2.22 Sep 22, 2026
8 checks passed
@dan-petty
dan-petty deleted the fix/sanitizer-prose-false-positive branch September 22, 2026 17:28
dan-petty added a commit that referenced this pull request Sep 22, 2026
…397)

The published v0.2.22 release description reads "Secret <masked-token> & Vault Lease Lifecycle" and "Prompt Caching & Token <masked-token>". CHANGELOG.md holds the correct text -- "Secret Resolution", "Token Governance" -- and the masker corrupted it on the way out.

#392 narrowed this rule by requiring the value after a credential keyword to carry a digit, a capital, or a separator. A capital was the wrong signal. Every ordinary word is capitalised at the start of a sentence or in a heading, and a changelog heading is exactly where this rule gets applied. I tested that fix against lowercase prose only -- "unify secret resolution", "token counting" -- so the case that was actually going to break it was never exercised.

A leading capital marks a word. An internal capital, a digit, a separator, or a length no English word reaches marks a token. `Bearer ghp_A1b2...`, `token aBcDeFgHiJkL` and a twenty-six character opaque string are still masked; "Secret Resolution", "Token Governance" and "Password Management Policy" are left alone.

The v0.2.22 release description is republished from the corrected changelog separately.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant